package com.dfbz.demo;


/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01_构造方法 {

    public static void main(String[] args) {


        String s1 = new String();
        System.out.println(s1);
        System.out.println("-------------");

        String s2 = new String("hello");
        System.out.println(s2);
        System.out.println("-------------");

        char[] chars = {'a', 'b', 'c'};
        String s3 = new String(chars);
        System.out.println(s3);
        System.out.println("-------------");

        byte[] bytes = {97, 98, 99};
        String s4 = new String(bytes);
        System.out.println(s4);
        System.out.println("-------------");


        byte[] data = {97, 98, 99, 100, 101};
        String s5 = new String(data, 1, 2);
        System.out.println(s5);
        System.out.println("----------");

    }
}
